class HomeController < ApplicationController

  def index
    @catalog_zhs = CatalogZh.find :all,:order=>"req"
    @item_zhs_new = ItemZh.find :all, :limit=>10, :order=>"created_at desc"
    @item_zhs_recommended= ItemZh.find :all, :order=>"req_recommended", :conditions=>"recommended=1"
    @subtitle = ""
  end
  
  def catalog
    @catalog_zhs = CatalogZh.find :all,:order=>"req"
    @item_zhs_new = ItemZh.find :all, :limit=>10, :order=>"created_at desc"
    @catalog_zh = CatalogZh.find params[:id]
    @item_zhs= @catalog_zh.item_zhs
    @subtitle=" - "+ @catalog_zh.name
  end
  
  def item
    @catalog_zhs = CatalogZh.find :all,:order=>"req"
    @item_zhs_new = ItemZh.find :all, :limit=>10, :order=>"created_at desc"
    @item_zh= ItemZh.find params[:id]
    @subtitle=" - "+ @item_zh.name + ' 项目简介'
  end
  
  
end
